{% extends "theme/layout.html" %}
{% block title %}{{ post.title }}{% endblock %}
{% block page_div_id %}detail{% endblock %}

{% block content %}
<div id="innerContainer">
  <div class="innerTop"></div>
  <div id="outerContent">
    <div id="content">
      <div class="contentTop"></div>
      <ul id="posts">
        <div class="postsTop"></div>
        <li class="list">
          <div class="postHeader">
            <h2>{{ post.title|e }}
              {% if post.category %}
              <span class="category"> - [<a href="{{ post.category.getUrl() }}">{{ post.category.name|e }}</a>]</span>
              {% endif %}
            </h2>
            <h3>{{ post.date|date("%Y-%m-%d") }}</h3>
          </div>
          <div class="postBody">
            {{ post.content }}
            <div class="clear"></div>
          </div>
          <div class="postFooter">
            <div class="tags">Tag：{{ post.taglist }} </div>
            <div class="menubar"><span class="author"> 发表于<span class="time">{{ post.date|date('%H:%M:%S') }}</span> | <a href="#" class='edit'>编辑</a></div>
          </div>
        </li>
        <div class="postsBottom"></div>
      </ul>
      <a name="cmt"></a>
      <ul id="comments">
        <h2>评论</h2>
        {% for comment in comments %}
        <li>
          <div class='cmtBody'>{{ comment.content }}</div>
          <div class='menubar'><span class='author'>{{ comment.name }} | </span> 发表于<span class='time'>{{ comment.created|date('%Y-%m-%d %H:%M:%S') }}</span> <!-- <span>[<a href="#" onclick="#" rel="facebox">回复</a>]</span> --></div>
        </li>
        {% endfor %}
      </ul>
      {% if post.allow_comment %}
      <div id="commentForm">
        <h2>发表评论</h2>
        <a name="cmt_form"></a>
        <form method="post" action="/comment" onsubmit="return check_cmt(this);">
          <div>
            <label for="cname">姓　名</label>
            <input class="textField" id="cname" name="name" type="text" />
          </div>
          <div>
            <label for="cemail">E-Mail</label>
            <input class="textField" id="cemail" name="email" type="text" />
          </div>
          <div>
            <label for="chomepage">地　址</label>
            <input class="textField" id="chomepage" name="homepage" type="text" />
          </div>
          <div>
            <textarea name="content" rows="8"></textarea>
          </div>
          <div class="submit">
            <input type="hidden" name="post" value="{{ post.key() }}" />
            <input type="hidden" name="checksum" value="{{ checksum }}" />
            <input class="button" id="submit_comment" name="addsub" value="提交" type="submit" />
            <span class="rememberBox">
            <input id="remember" name="remember" checked="true" type="checkbox" class="cremember" style="margin:0; padding:0; border:0; width:auto;" />
            记住我</span>
          </div>
        </form>
      </div>
      <script src="/static/js/comment_helper.js" type="text/javascript"></script>
      {% endif %}
      <div class="contentBottom"></div>
    </div>
  </div>
  <div id="outerSidebar">
    <div id="sidebar">
      <div class="sideTop"></div>
      {% for widget in blog.sidebar(1) %}
      <div id="{{ widget.key_name }}" class="module">
      	<div class="modTop"></div>
      	<h2>{{ widget.name() }}</h2>
      	<div class="modBody">
      	  {{ widget.body() }}
        </div>
        <div class="modBottom"></div>
      </div>
      {% endfor %}
      <div class="sideBottom"></div>
    </div>
  </div>
  <div class="clear"></div>
  <div class="innerBottom"></div>      
</div>
{% endblock %}